package com.abl.core.mybatis.mapper;

import com.abl.core.domain.db.MtRoomUserAuth;
import com.mybatisflex.core.BaseMapper;
import com.mybatisflex.core.query.QueryWrapper;

import static com.abl.core.domain.db.table.MtRoomUserAuthTableDef.MT_ROOM_USER_AUTH;

public interface MtRoomUserAuthMapper extends BaseMapper<MtRoomUserAuth> {

    default MtRoomUserAuth getById(String mtId, String userId) {
        return selectOneByQuery(
                QueryWrapper.create()
                        .and(MT_ROOM_USER_AUTH.MT_ID.eq(mtId))
                        .and(MT_ROOM_USER_AUTH.USER_ID.eq(userId))
        );
    }
}